﻿using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace CarbonExchange.Tests
{
    /// <summary>
    /// Summary description for AmeeDataItemTestcs
    /// </summary>
    [TestClass]
    public class AmeeDataItemTests
    {
        [TestMethod]
        public void GetByPathTest()
        {
            CarbonExchange.Bll.AmeeDataItemFactory factory = new CarbonExchange.Bll.AmeeDataItemFactory();
            var item = factory.GetByPath("home/waste", "B8AEC0291F84");
            Assert.IsNotNull(item);
            Assert.AreEqual("B8AEC0291F84", item.Id);
            Assert.AreEqual("B8AEC0291F84", item.Name);
            Assert.AreEqual("/home/waste/B8AEC0291F84", item.Path);
            Assert.AreEqual(101.8m, item.GetValue<decimal>("kgPerPersonPerYear"));
        }
    }
}
